﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->
    
<phone:PhoneApplicationPage 
    x:Class="PhoneToolkitSample.Samples.PhoneTextBoxSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="{StaticResource ApplicationTitle}"
                       Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="phonetextbox" 
                       Margin="9,-7,0,0" 
                       Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>
        
        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ScrollViewer Margin="0, 0, -12, 0">
                <StackPanel Orientation="Vertical">
                    <toolkit:PhoneTextBox Hint="First Name" />
                    <toolkit:PhoneTextBox Hint="Last Name"
                                         MaxLength="40"
                                         LengthIndicatorVisible="True" 
                                         LengthIndicatorThreshold="10" />
                    <toolkit:PhoneTextBox Hint="Subject"
                                          MaxLength="200"
                                          LengthIndicatorVisible="True"
                                          InputScope="Text"/>
                    <TextBlock Text="Message"
                           Foreground="{StaticResource PhoneSubtleBrush}"
                           Margin="12, 0,0,0"/>
                    <!-- Note: the following allows for the user to enter more than 
                        500 characters, but the length indicator displays the
                        number of characters entered out of 500, even if the length
                        of the text entered is greater than 500.      -->
                    <toolkit:PhoneTextBox MinHeight="200"
                                         DisplayedMaxLength="500"
                                         LengthIndicatorVisible="True"
                                         TextWrapping="Wrap" 
                                         AcceptsReturn="True" />

                    <TextBlock Text="Action Icon"
                           Style="{StaticResource PhoneTextGroupHeaderStyle}" />
                    <toolkit:PhoneTextBox Hint="Search" 
                                         ActionIcon="/Images/Search.png"
                                         ActionIconTapped="Search_ActionIconTapped"/>
                    <toolkit:PhoneTextBox ActionIcon="/Images/Search.png"
                                         MinHeight="150"
                                         TextWrapping="Wrap" AcceptsReturn="True" />
                
                    <TextBlock Text="This control is currently experimental and we are looking for your feedback. If you have comments about the PhoneTextBox or other Toolkit controls, visit the Windows Phone Toolkit on CodePlex."
                               Margin="12" Style="{StaticResource PhoneTextSubtleStyle}" TextWrapping="Wrap" />
                    <HyperlinkButton Content="Toolkit on CodePlex" 
                                     NavigateUri="http://silverlight.codeplex.com/"
                                     TargetName="_self"
                                     Foreground="{StaticResource PhoneAccentBrush}" />
                </StackPanel>
            </ScrollViewer>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>
